package com.linkoog.devtools.http.request.http_response.response.response_body.body.text;

import com.intellij.openapi.project.Project;
import com.linkoog.devtools.http.request.common.response_body.text.JsonResponseBody;
import com.linkoog.devtools.http.request.http_response.response.response_body.BodyPanel;
import com.linkoog.devtools.intellij.editor.JSONEditerPanel;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class JSONBodyPanel extends JSONEditerPanel implements BodyPanel<JsonResponseBody> {

    public JSONBodyPanel(@NotNull Project project) {
        super(project);
    }

    @Override
    public void resetResponseBody(@NotNull JsonResponseBody responseBody) {
        setEditorText(responseBody.getValue());
    }

    @Override
    public JPanel getPanel() {
        return this;
    }
}
